<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>登录</title>
#include("./jscss.html")
<script src="../inc/lib/sha1.js"></script>
<script src="../inc/lib/jquery.placeholder.min.js"></script>
<link href="../inc/css/login.css" rel="stylesheet">
<script type="text/javascript">
	$(function(){
		$('#bg').css("height",$(window).height());
		$('input').placeholder();
		if(top.location != self.location){  
	    	top.location = self.location;//防止页面被框架包含  
	    } 
		$('input[name="password"]').keydown(function(e){
			if(e.keyCode==13){
				login();
			}
		});
	})
	
	function login(){
		var userName = $('input[name="userName"]').val();
		var password = hex_sha1($('input[name="password"]').val());
		$.post('dologin',{password:password,username:userName},function(data){
			if(data.result==0){
				window.location.replace('index');
			}else{
				$.messager.alert('提示',
					'您输入的用户名或密码错误'
				);
			}
		},'json');
	}
</script>
</head>
<body>
	<div id="content">
		<img alt="" src="../inc/img/Main_bg.jpg" id="bg"/>
		<img alt="" src="../inc/img/title.png" id="sys_title"/>
		<div class="panel">
			<div class="username"><input name="userName" type="text" maxlength="20" style="width: 308px;background: url('../inc/img/Login_DL_1.png');" value="" placeholder="请输入用户名"/></div>
			<div class="password"><input name="password" type="password" maxlength="20" style="width: 308px;background: url('../inc/img/Login_DL_2.png');" value="" placeholder="请输入密码"/></div>
			<div id="button" onclick="login();"></div>
		</div>
	</div>
</body>
</html>